package com.example.recycleview;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.media.MediaPlayer;

public class MyReceiver extends BroadcastReceiver {


    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO: This method is called when the BroadcastReceiver is receiving
        // an Intent broadcast.
        Intent intent1 = new Intent(context, MyService1.class);
        context.startService(intent1);//启动MyService1
        Intent intent2 = new Intent(context, MainActivity4.class);
        //intent2.putExtra("iscast", true);  //携带数据
        //新建栈用来存放被启动的Activity（当已经存在时，只做移动处理）
        intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent2);

        //throw new UnsupportedOperationException("Not yet implemented");
    }
}